﻿<%@ Page Title="" Language="C#" MasterPageFile="~/share/Site1.Master" AutoEventWireup="true"
    CodeBehind="Main.aspx.cs" Inherits="RGPWEB.admin.Main" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">
        //左侧工具栏切换
        function on_tool() {
            var leftdiv = document.getElementById("leftdiv");
            var splitdiv = document.getElementById("splitdiv");
            var rightdiv = document.getElementById("rightdiv");
            var frameshow = document.getElementById("frameshow");
            //判断菜单是否隐藏
            if (leftdiv.style.display == "none") {
                leftdiv.style.display = "block";
                frameshow.src = "../inc/images/splitter_horCol.gif";
            }
            else {
                leftdiv.style.display = "none";
                frameshow.src = "../inc/images/splitter_horExp.gif";
            }
        }

        //自动适应内容大小
        function changewin() {
            var modulePanel = document.getElementById("modulePanel");
            modulePanel.style.height = window.frames["modulePanel"].document.body.scrollHeight;
        }

        window.onresize = function() {
            changewin();
        }        

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">
    <div style="border-bottom: 1px #000000 solid; border-top: 1px #000000 solid; height: 100%">
        <div id="leftdiv">
            <div style="background-color: #e5e4e5; height: 22px; line-height: 22px;">
                <div style="float: left; margin-left: 5px; height: 22px; line-height: 22px;">
                    系统菜单</div>
            </div>
            <div class="pbox5">
                <asp:TreeView ID="MenuTreeView" runat="server" ImageSet="Msdn" NodeIndent="10">
                    <ParentNodeStyle Font-Bold="False" />
                    <HoverNodeStyle BorderColor="#ff0000" />
                    <SelectedNodeStyle BorderColor="#888888" BorderStyle="Solid" BorderWidth="1px" Font-Underline="False"
                        HorizontalPadding="3px" VerticalPadding="1px" />
                    <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
                        NodeSpacing="1px" VerticalPadding="2px" />
                </asp:TreeView>
                <a id="alink" href="Welcome.aspx" target="modulePanel" style=" display:none;"></a>
            </div>
        </div>
        <div id="splitdiv">
            <div style="background-color: #e5e4e5; float: right; height: 19px; width: 8px; text-align: left;
                padding-top: 3px;" onclick="on_tool();">
                <img alt="" id="frameshow" src="../inc/images/splitter_horCol.gif" />
            </div>
        </div>
        <div style="border-left: 1px #9f9d9f solid; float: left;">
            <div id="rightdiv">
                <iframe src="Welcome.aspx" name="modulePanel" scrolling="no" id="modulePanel" width="100%"
                    height="100%" frameborder="0" onload="this.height=modulePanel.document.body.scrollHeight;">
                </iframe>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        //2. 只打开一个节点,关闭其他兄弟节点(Just one expanded node, all other will collaps)
        function TreeView_ToggleNode(data, index, node, lineType, children) {
            var img = node.childNodes[0];
            var newExpandState;
            try {
                //***折叠兄弟节点(Collapse Brothers)-----
                CollapseBrothers(data, children);
                //---------------------------------------

                if (children.style.display == "none") {
                    children.style.display = "block";
                    newExpandState = "e";
                    if ((typeof (img) != "undefined") && (img != null)) {
                        if (lineType == "l") {
                            img.src = data.images[15];
                        }
                        else if (lineType == "t") {
                            img.src = data.images[12];
                        }
                        else if (lineType == "-") {
                            img.src = data.images[18];
                        }
                        else {
                            img.src = data.images[5];
                        }
                        img.alt = data.collapseToolTip.replace(/\{0\}/, TreeView_GetNodeText(node));
                    }
                }
                else {
                    children.style.display = "none";
                    newExpandState = "c";
                    if ((typeof (img) != "undefined") && (img != null)) {
                        if (lineType == "l") {
                            img.src = data.images[14];
                        }
                        else if (lineType == "t") {
                            img.src = data.images[11];
                        }
                        else if (lineType == "-") {
                            img.src = data.images[17];
                        }
                        else {
                            img.src = data.images[4];
                        }
                        img.alt = data.expandToolTip.replace(/\{0\}/, TreeView_GetNodeText(node));
                    }
                }
            }
            catch (e) { }
            data.expandState.value = data.expandState.value.substring(0, index) + newExpandState + data.expandState.value.slice(index + 1);
        }

        //折叠兄弟节点(Collapse Brothers)
        function CollapseBrothers(data, childContainer) {
            var parent = childContainer.parentNode;
            for (i = 0; i < parent.childNodes.length; i++) {
                if (parent.childNodes[i].tagName.toLowerCase() == "div") {
                    if (parent.childNodes[i].id != childContainer.id) {
                        parent.childNodes[i].style.display = "none"
                    }
                }
                else if (parent.childNodes[i].tagName.toLowerCase() == "table") {
                    var treeLinks = parent.childNodes[i].getElementsByTagName("a");
                    var j = 0;
                    if (treeLinks[j].firstChild.tagName) {
                        if (treeLinks[j].firstChild.tagName.toLowerCase() == "img") {
                            var img = treeLinks[j].firstChild;
                            img.src = data.images[4];
                        }
                    }
                }
            }
        }

        window.onload = function() {
            alink.click();
        }
    </script>

</asp:Content>
